package com.xxl.job.admin.dao;

import com.xxl.job.admin.core.model.XxlJobUser;
import com.xxl.job.core.biz.model.DbInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 数据库连接信息
 */
@Mapper
public interface DbInfoDao {

    public List<DbInfo> pageList(@Param("offset") int offset,
                                     @Param("pagesize") int pagesize,
                                 @Param("name") String name,
                                 @Param("belong") String belong,
                                 @Param("remark") String remark,
                                 @Param("createTimeStart") Date createTimeStart,
                                 @Param("createTimeEnd") Date createTimeEnd);
    public int pageListCount(@Param("offset") int offset,
                             @Param("pagesize") int pagesize,
                             @Param("name") String name,
                             @Param("belong") String belong,
                             @Param("remark") String remark,
                             @Param("createTimeStart") Date createTimeStart,
                             @Param("createTimeEnd") Date createTimeEnd);

    int save(DbInfo dbInfo);

    DbInfo loadById(@Param("id") long id);

    int update(DbInfo dbInfo);

    int delete(@Param("id") long id);

    List<DbInfo> queryAll();

    List<DbInfo> queryByDataType(@Param("dbType") String dbType);
}
